package com.pro.service.imple;

import com.pro.mapper.JsLoginRecordMapper;
import com.pro.pojo.JsLoginRecord;
import com.pro.service.JsLoginRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:JsLoginRecordServiceImple
 * Package:com.pro.service.imple
 * Description: 登录日志serviceImple
 *
 * @Date:2021/11/4 上午 9:34
 * @Author:WYH
 */
@Service
public class JsLoginRecordServiceImple implements JsLoginRecordService {

    @Autowired(required = false)
    private JsLoginRecordMapper jsLoginRecordMapper;

    /**
     * @author WYH
     * @date 2021/11/7 下午 6:37
     * @content : 查询登录日志的所有内容 进行分页查询
     */
    @Override
    public List<JsLoginRecord> getJsJsLoginRecord(Integer page,Integer limit) {
        page = (page-1)*limit;
        List<JsLoginRecord> jsJsLoginRecord = jsLoginRecordMapper.getJsJsLoginRecord(page,limit);
        return jsJsLoginRecord;
    }

    /**
     * @author WYH
     * @date 2021/11/7 下午 6:37
     * @content : 记录所有登录值日的总个数
     */
    @Override
    public int count() {
        return jsLoginRecordMapper.count();
    }
}
